using System;
using System.Globalization;
using System.Windows.Data;
using MinoChat.Ui.Enums;

namespace MinoChat.Converters;

/// <summary>
/// 根据 IsProcessing 状态转换图标类型
/// IsProcessing = true => Running
/// IsProcessing = false => Send
/// </summary>
public class ProcessingToIconConverter : IValueConverter
{
    public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
    {
        if (value is bool isProcessing)
        {
            return isProcessing ? IconType.Running : IconType.Send;
        }
        return IconType.Send;
    }

    public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
    {
        throw new NotImplementedException();
    }
}
